package com.application.fabric.users.config.Interceptor;

import com.application.fabric.test.Token.Token01;
import com.application.fabric.test.Token.Token02;
import io.jsonwebtoken.Claims;

import java.util.Date;


public class JwtUtils {
    public static void main(String[] args) {
        Token02 token02 = new Token02();
        String token = token02.geneJsonWebToken("ceshi","130");
        System.out.println(token);

        Claims claims = token02.checkJWT(token);

        String Phone = claims.get("userPhone").toString();

//        判断token过期
        Date now = new Date();
        System.out.println( now.compareTo(claims.getExpiration()));
        System.out.println(claims.getExpiration());
        System.out.println(Phone);
    }
}
